package com.hh.springboot.service.impl;

import com.hh.springboot.mapper.CommodityMapper;
import com.hh.springboot.model.Commodity;
import com.hh.springboot.service.CommodityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommodityServiceImpl implements CommodityService {
    @Autowired
    private CommodityMapper commodityMapper;
    @Override
    public List<Commodity> getCommodities() {
        return commodityMapper.selectAll();
    }

    @Override
    public Commodity getCommodity(int id) {
        return commodityMapper.selectByPrimaryKey(id);
    }
}
